home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / tel2305b.zip / LPR_MAN.DOC < prev    next >
Text File  |  1991-06-27  |  24KB  |  555 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                                    LPR, LPQ, LPRM
  7.                              Network Printing Utilities
  8.                                (for MS-DOS Computers)
  9.  
  10.  
  11.                                     Paul Hilchey
  12.                            University Computing Services
  13.                          The University of British Columbia
  14.  
  15.                                  September 18, 1989
  16.  
  17.                                  Copyright (C) 1989
  18.                          The University of British Columbia
  19.  
  20.  
  21.             Introduction
  22.  
  23.             These utilities  allow access to printers attached to remote
  24.             computer  systems   via  a   TCP/IP  network.     They   are
  25.             implementations of the like named Unix utilities.
  26.  
  27.  
  28.             Things You Will Need
  29.  
  30.             You will  need to have access to a computer that will accept
  31.             print jobs from you.  It must be accessible from the network
  32.             and support the Berkeley Line Printer protocol (available on
  33.             most Unix systems).
  34.  
  35.             Your computer  must  have  a  suitable  network  connection.
  36.             Either
  37.  
  38.                1 An Ethernet connection with one of the supported
  39.                  adapter boards.  For an IBM PC, XT, AT, PS/2 model 30,
  40.                  or compatible, the supported ethernet adapter boards
  41.                  are:
  42.                    y  3COM 3C501 Etherlink
  43.                    y  MICOM NI5210
  44.                    y  Ungermann-Bass PC-NIC
  45.                    y  Western Digital WD8003E
  46.  
  47.                  For IBM PS/2 models, 50, 60, 70, or 80, or compatible,
  48.                  the supported boards are:
  49.                    y  Ungermann-Bass NICps/2
  50.                    y  3COM 3C523 Etherlink/MC
  51.  
  52.                2 A hard-wired serial port supporting the SLIP protocol.
  53.                  A serial connection is slower than an Ethernet
  54.                  connection, but may still be adequate.
  55.  
  56.  
  57.             Getting Started
  58.  
  59.             The software is available by anonymous FTP from mtsg.ubc.ca.
  60.             Use binary  mode to  get  the  file  LP.EXE  from  the  PC1:
  61.             directory.
  62.  
  63.  
  64.  
  65.             Instructions on  how to  install these  utilities are in the
  66.             appendix.
  67.  
  68.  
  69.             Problem Reports
  70.  
  71.             Problem reports may be sent to Paul_Hilchey@mtsg.ubc.ca.
  72.  
  73.  
  74.             Acknowledgements
  75.  
  76.             Portions of  this software  were developed  by the  National
  77.             Centre for  Supercomputer Applications  at the University of
  78.             Illinois at Urbana-Champaign.
  79.  
  80.             Portions of  this software were developed by The Educational
  81.             Resources Center at Clarkson University.
  82.  
  83.             PostScript is a registered trademark of Adobe Systems Inc.
  84.             Unix is a registered trademark of AT&T.
  85.             IBM PC, XT, AT, and PS/2 are registered trademarks of
  86.             International Business Machines Corporation.
  87.             MS-DOS is a registered trademark of Microsoft Corporation.
  88.             NIC is a trademark of Ungermann-Bass.
  89.             EtherCard PLUS is a trademark of Western Digital
  90.             Corporation.
  91.             Ethernet is a trademark of Xerox Corporation.
  92.             3COM and Etherlink are trademarks of 3COM Corporation.
  93.  
  94.  
  95.  
  96.  
  97.                                   Printing a File
  98.  
  99.  
  100.             To print  a file, enter the lpr command followed by the name
  101.             of the  file.   For  example,  if  you  had  a  file  called
  102.             readme.txt that you wanted to print, you would use
  103.  
  104.                  lpr readme.txt
  105.  
  106.             If all goes well, the file will be sent over the network and
  107.             then printed.   When  lpr has  finished sending the file, it
  108.             reports done and returns to the DOS prompt.
  109.  
  110.             Printing multiple copies
  111.  
  112.             You can print more than one copy of a file by specifying the
  113.             -# option.  For example:
  114.  
  115.                  lpr -#3 readme.txt
  116.  
  117.             will produce  three copies  of readme.txt.   Note  that  the
  118.             remote computer  you are  sending your  print files  to  may
  119.             impose limits on how many copies you can produce.
  120.  
  121.             Printing files with page breaks and page titles
  122.  
  123.             To have  your document broken up into pages and printed with
  124.             page titles, use the -p option.  For example:
  125.  
  126.                  lpr -p readme.txt
  127.  
  128.             In this  example, each  page would  have readme.txt  as  the
  129.             title.   If you  want a  title other than the file name, use
  130.             the -T option.  For example:
  131.  
  132.                  lpr -p -T top_secret sdi.doc
  133.  
  134.             The pages  would be titled with top_secret.  Note that there
  135.             must not  be any spaces within your title.  The -T option is
  136.             only of use in combination with the -p option.
  137.  
  138.             You can  also specify  the page  width to  use with  the  -w
  139.             option.  For example:
  140.  
  141.                  lpr -p -w72 readme.txt
  142.  
  143.             will format the text into lines of up to 72 characters.  The
  144.             -w option only works in combination with the -p option.
  145.  
  146.             Indenting
  147.  
  148.             To have  your output  shifted away from the left margin, use
  149.             the -i option.  For example:
  150.  
  151.                  lpr -i readme.txt
  152.  
  153.  
  154.  
  155.             The printout  will be  shifted to the right by eight spaces.
  156.             For different  indents, you can specify the number of spaces
  157.             to use:
  158.  
  159.                  lpr -i4 readme.txt
  160.  
  161.             will indent  by four  spaces.   There must  not be  a  space
  162.             between the -i and the number.
  163.  
  164.             Printing TeX
  165.  
  166.             If you  use the TeX text processing package, you can use lpr
  167.             to print  your .DVI  files.   To do  so, you must use the -d
  168.             option.  For example:
  169.  
  170.                  lpr -d sample.dvi
  171.  
  172.             The remote  computer that is doing your printing for you may
  173.             or may not be able to print DVI files; check with the system
  174.             administrator to  find out.  Note also that there will be no
  175.             opportunity for  you to  do a font substitution when the DVI
  176.             file is  interpreted, so you must not use any fonts that are
  177.             not available on the printer.
  178.  
  179.             Printing PostScript
  180.  
  181.             If the  printer you will be using understands PostScript, it
  182.             should automatically  recognize the  `%!' signature found at
  183.             the start of most PostScript files and print them correctly.
  184.             You don't need to specify any formatting options.
  185.  
  186.             Printing several files
  187.  
  188.             You can  print more  than one  file at  a time; just include
  189.             each file name with the lpr command.  For example:
  190.  
  191.                  lpr -p c:\autoexec.bat c:\config.sys -d -#2 thesis.dvi
  192.  
  193.             As you  can see  in the example, you can intermix formatting
  194.             options in  with the  files to  be printed.  The options and
  195.             file names  are processed  from left  to right.    Whichever
  196.             formatting options  are currently in effect when lpr finds a
  197.             file name are the ones that are used for that file.  Once an
  198.             option has  been set,  it remains in effect until changed or
  199.             over-ridden by another option.
  200.  
  201.             Using a different printer
  202.  
  203.             Your output  is normally  sent to  the printer identified by
  204.             the PRINTER  and SERVER environment variables (see part 4 of
  205.             the appendix).  You can use a different printer and/or print
  206.             server by  giving the  -P and/or  -S options.  The -P option
  207.             changes the  name of  the printer  to use.   The  -S  option
  208.             changes the  address of  the print  server computer  to use.
  209.             For example:
  210.  
  211.                  lpr -P LW-407 -S havarti lp.doc
  212.  
  213.  
  214.  
  215.             output will be sent to the printer called LW-407 attached to
  216.             the computer called havarti.
  217.  
  218.             When you  use the -P and -S options, they apply only to that
  219.             command.     They  don't   change  the  PRINTER  and  SERVER
  220.             environment  variables.     If   the  PRINTER   and   SERVER
  221.             environment variables have not been set, you must use the -P
  222.             and -S options.
  223.  
  224.             Miscellaneous options
  225.  
  226.             Print jobs  are normally  separated by  a `burst page' which
  227.             identifies the  owner of  the output.   Printed on the burst
  228.             page are  the job  classification and the job name.  The job
  229.             classification defaults to your machine name unless set with
  230.             the -C  option.   The job  name defaults  to the name of the
  231.             file being  printed unless  set with  the -J  option.    For
  232.             example:
  233.  
  234.                  lpr -C my_output -J beaujolais wine.lst
  235.  
  236.             The job  classification and  job name  must not  contain any
  237.             spaces.   If a  burst page is not necessary, you can use the
  238.             -h option to prevent it from being printed.
  239.  
  240.             The -f  option is  used if  the your  file is formatted with
  241.             FORTRAN  carriage  control  characters.    FORTRAN  carriage
  242.             control is seldom used on micro-computers.
  243.  
  244.             The -l  option is  used if  your file  contains non-printing
  245.             control characters that the printer can understand.
  246.  
  247.  
  248.  
  249.  
  250.                        Checking the Status of Your Print Jobs
  251.  
  252.  
  253.             Since several people may want to use the same printer at the
  254.             same time,  and each job may take a length of time to print,
  255.             a  job  that  you  send  may  not  be  printed  immediately.
  256.             Instead, it may have to wait in a queue until the printer is
  257.             available.   To find  out if  your output  has been printed,
  258.             enter the  lpq command.  The remote computer will be queried
  259.             and the  status  of  the  jobs  it  is  processing  will  be
  260.             displayed.  For example,
  261.  
  262.                  lpq
  263.                  Owner  Files      Job#   Job Name  Status         Size
  264.                  kent   champagne  34702  caviar    Printing       19192
  265.                  sue    smongo.c   31241  smongo.c  Printed        27182
  266.                  paul   games.txt  34789  games     Awaiting Print 84456
  267.  
  268.             As you  can see  in the example, the status display includes
  269.             other peoples'  jobs. To check the status of your jobs only,
  270.             add your name to the lpq command:
  271.  
  272.                  lpq paul
  273.  
  274.             Only jobs owned by the user paul would be displayed.
  275.  
  276.             Periodic update
  277.  
  278.             To have  the status  display updated  every few seconds, use
  279.             the + option:
  280.  
  281.                  lpq +
  282.  
  283.             The status  will be  displayed and  then refreshed every few
  284.             seconds.   To stop  the  display,  press  any  key  on  your
  285.             keyboard.  It will stop automatically when there are no jobs
  286.             to report on.  You can also set a particular delay interval:
  287.  
  288.                  lpq +5
  289.  
  290.             will wait five seconds between display refreshes.
  291.  
  292.             Using a different printer
  293.  
  294.             As with  the lpr  command, lpq  normally  uses  the  printer
  295.             identified by  the PRINTER  and SERVER environment variables
  296.             (see part  4 of the appendix), but you can use the -P and -S
  297.             options to  select a different printer.  lpq only checks the
  298.             queue for the printer selected.
  299.  
  300.  
  301.  
  302.  
  303.                                  Cancelling Output
  304.  
  305.  
  306.             If you  change your  mind after sending a file for printing,
  307.             but before  it has  actually been printed, you can cancel it
  308.             with the lprm command.  For example:
  309.  
  310.                  lprm 34789
  311.  
  312.             would cancel  job 34789.   The  job number  (34789  in  this
  313.             example) is  assigned when you submit the file for printing,
  314.             and can  be obtained with the lpq command (described above).
  315.             You can only cancel your own jobs.
  316.  
  317.             If you  want to  cancel all  of your  jobs that are awaiting
  318.             print, use the - option in place of the job number:
  319.  
  320.                  lprm -
  321.  
  322.             would cancel any of your jobs that had not yet been printed.
  323.             lprm will report the names of any files it removes.
  324.  
  325.             Using a different printer
  326.  
  327.             As with  the lpr  and lpq  commands, lprm  normally uses the
  328.             printer identified  by the  PRINTER and  SERVER  environment
  329.             variables, but you can use the -P and -S options to select a
  330.             different printer.
  331.  
  332.  
  333.  
  334.  
  335.                              Appendix A - Installation
  336.  
  337.  
  338.             These installation  instructions assume  you have a moderate
  339.             amount of  technical knowledge  of PC's,  MS-DOS, and  local
  340.             area networks.   You  should have  correctly configured  and
  341.             installed your  Ethernet adapter before beginning with these
  342.             instructions.
  343.  
  344.             1. Unpack archive file
  345.  
  346.             LP.EXE is  a self-extracting  archive of  the files you will
  347.             need.  Simply enter LP to extract the files:
  348.                    lpr.exe      - program for printing files
  349.                    lpq.exe      - program to check on print status
  350.                    lprm.exe     - program to cancel a print job
  351.                    config.tel   - network configuration file
  352.                    slip8250.com - packet driver for serial port
  353.                    manual.doc   - this manual
  354.                    manual.ps    - this manual, in PostScript
  355.  
  356.             After unpacking  the archive,  you will  want  to  move  the
  357.             lpr.exe, lpq.exe,  and lprm.exe  files to  a directory along
  358.             your search path.
  359.  
  360.             2. Install SLIP packet driver
  361.  
  362.             If you  do not  have an  Ethernet connection, but do have an
  363.             asynchronous serial  port connection that supports SLIP (the
  364.             serial line  internet protocol),  you  can  still  use  this
  365.             software.   You will,  however, have  to  install  an  extra
  366.             program called  a packet  driver.    If  you  are  using  an
  367.             Ethernet connection, skip this section.
  368.  
  369.             The packet  driver you  need  to  install  is  in  the  file
  370.             slip8250.com.   It is  a Terminate  and Stay  Resident (TSR)
  371.             type program; running the program will install it.  You will
  372.             want to  run the  program from within your autoexec.bat file
  373.             so it  is loaded every time you re-boot your machine.  To do
  374.             so,
  375.  
  376.                1 Copy the slip8250.com file to a directory in your
  377.                  search path.
  378.  
  379.                2 Choose an available interrupt number in the range 0x60
  380.                  to 0x7f.  On most machines, interrupt 0x60 is probably
  381.                  available and can be used.
  382.  
  383.                3 Determine which serial port (COM1 or COM2) you are
  384.                  going to use and at what baud rate.
  385.  
  386.                4 The command to install the packet driver is of the form
  387.  
  388.                       slip8250 <interrupt number> slip <irq number>
  389.                                 <port address> <baud rate>
  390.  
  391.  
  392.  
  393.                  If you are using serial port COM1, the correct values
  394.                  for <irq number> and <port address> are 4 and 0x3F8.
  395.                  For COM2, the correct values are 3 and 0x2F8.  For
  396.                  example, to install the packet driver using COM1 at
  397.                  9600 baud, you would add the line
  398.  
  399.                  slip8250 0x60 slip 4 0x3f8 9600
  400.  
  401.                  to your autoexec.bat file.
  402.  
  403.             After you  have added  this line  to your autoexec.bat file,
  404.             you must re-boot your machine to have it take effect.
  405.  
  406.             3. Modify configuration file
  407.  
  408.             If you  use the  NCSA Telnet program on your PC, you already
  409.             have a  config.tel file  and should  use that instead of the
  410.             one unpacked from the archive.  The only change you may need
  411.             to make is to define the `myname' entry, which specifies the
  412.             name that  your machine  is known  by.   Once you  have done
  413.             that, skip to section 4.
  414.  
  415.             If you  do not  already have  them, obtain  an IP address, a
  416.             subnet mask,   and  a name  for your machine from your local
  417.             network administrator.
  418.  
  419.             Next,  edit   the  config.tel  file  to  reflect  the  above
  420.             information, and  also the  type and  configuration of  your
  421.             network connection.   Only  seven  of  the  entries  in  the
  422.             config.tel file are essential:
  423.  
  424.                  myname=fred.phys.ubc.ca
  425.                       Your machine  must have  a name  that it  is to be
  426.                       known  by.     Check   with  your   local  network
  427.                       administrator to find a suitable name.
  428.  
  429.                  myip=128.189.123.456
  430.                       Your machine must have a unique address.  Using an
  431.                       incorrect address  can cause  problems  for  other
  432.                       people on  the network,  so be  careful.  See your
  433.                       local network administrator if you need help.
  434.  
  435.                  netmask=255.255.0.0
  436.                       Again, see your network administrator.
  437.  
  438.                  hardware=wd8003
  439.                       This entry identifies the type of Ethernet adapter
  440.                       you have, or if you are using a packet driver.
  441.                       
  442.                       Value     Ethernet Board           Requires
  443.                       3C501     3COM 3C501 Etherlink     interrupt,
  444.                       ioaddr
  445.                       PCNIC     Ungermann-Bass PC-NIC    address, ioaddr
  446.                       NI5210    Micom NI5210             address, ioaddr
  447.                       WD8003    Western Digital WD8003E  address, ioaddr
  448.                       NICps2    Ungermann-Bass NICps/2   address
  449.  
  450.  
  451.  
  452.                       3C523     3COM 3C523 Etherlink/MC  address, ioaddr
  453.                       packet    FTP packet driver        address, ioaddr
  454.                       
  455.                       Depending on  the Ethernet  adapter type,  you may
  456.                       need to  set the  interrupt, ioaddr,  and  address
  457.                       entries as indicated above.
  458.  
  459.                  interrupt=5
  460.                       The hardware  interrupt vector  number  that  your
  461.                       Ethernet adapter was configured for (Only required
  462.                       for 3C501 adapter).
  463.  
  464.                  address=d000
  465.                       The segment address of the Ethernet board's shared
  466.                       memory, entered  as four  hexadecimal digits.  Set
  467.                       to  the   value  that  your  Ethernet  adapter  is
  468.                       configured for.   If you are using a packet driver
  469.                       interface, set to 0.
  470.  
  471.                  ioaddr=360
  472.                       The I/O  base address  of the  Ethernet  board  in
  473.                       hexadecimal.   Set to the value that your Ethernet
  474.                       adapter is  configured for.   If  you are  using a
  475.                       packet driver  interface,  set  to  the  interrupt
  476.                       number (do not include the 0x prefix).
  477.  
  478.             Edit your  autoexec.bat file  to  the  set  the  environment
  479.             variable CONFIG.TEL  to be  the location  of your  config.tel
  480.             file.  For example:
  481.  
  482.                  set configtel=c:\utility\config.tel
  483.  
  484.             Complete documentation  on the  configuration  file  can  be
  485.             found in  chapter 6 of NCSA Telnet for the PC, Version 2.2TN
  486.             and Version 2.2D.
  487.  
  488.             4. Set up a default printer and server
  489.  
  490.             In order to use these utilities you need to specify the name
  491.             or address  of a  print server,  the computer  that receives
  492.             files from  you and  prints them.   Since a print server may
  493.             have several  printers attached  to it,  you  also  need  to
  494.             specify the  name of  the printer that you want to use.  You
  495.             obtain this information from the system administrator of the
  496.             machine that is to be your print server.
  497.  
  498.             You could give the printer name and server address each time
  499.             you use  one of  the printing  utilities, but  it is usually
  500.             more convenient  to put  them  in  the  PRINTER  and  SERVER
  501.             environment variables.   The SERVER environment variable, if
  502.             defined, gives  the name  or Internet  address of  the print
  503.             server to  use.   The PRINTER environment variable gives the
  504.             name of  the printer  on the  server machine  that is  to be
  505.             used.   You will probably want to set the PRINTER and SERVER
  506.             variables to suitable values in your autoexec.bat file.  For
  507.             example:
  508.  
  509.  
  510.  
  511.                  set printer=cntr
  512.                  set server=128.189.103.1
  513.  
  514.             If you  later have  a  file  that  you  want  printed  on  a
  515.             different printer,  you can either set PRINTER and/or SERVER
  516.             to that  printer, or  use the  -P and/or -S options with the
  517.             lpr, lpq, and lprm commands.
  518.  
  519.  
  520.  
  521.  
  522.                     Appendix B - Notes for System Administrators
  523.  
  524.  
  525.             These notes  are directed  to the  administrator of  a  Unix
  526.             system who  wishes to  allow use  of the  system as  a print
  527.             server.   They briefly  describe the  steps needed under Sun
  528.             OS, but  other Unix  systems should  be similar.  You should
  529.             also refer  to sections  12.3 (etc/hosts),  19.4 (hosts.lpd)
  530.             and chapter  22 (name  server) of the SunOS System & Network
  531.             Administration manual.
  532.  
  533.             The first  step is  to add  entries in  the LPD access file,
  534.             /etc/hosts.lpd, for  the machines  that are  to have access.
  535.             Edit the  file and insert the names of the machines, one per
  536.             line.   Note that  an IP  address is  not acceptable, so all
  537.             microcomputers that  are to  have access  must be assigned a
  538.             name.
  539.  
  540.             The second  step is  to add entries to either the /etc/hosts
  541.             file (if  you are  not using a domain name server) or to the
  542.             name server  database (if  you are  using  a  name  server).
  543.             Entries in  the /etc/hosts  file consist of IP addresses and
  544.             names, one entry per line.
  545.  
  546.             If you are using a name server, list your named.boot file to
  547.             find out  what the  relevant hosts  and rev.hosts  files are
  548.             called.   Next, edit  those files,  being sure to update the
  549.             serial numbers  at the  start of  them.  To make the changes
  550.             take effect, use the Unix command:
  551.  
  552.                  kill -HUP `cat /etc/named.pid`
  553.  
  554.             This will cause the name server daemon to re-read the files.
  555.